<?php
    require("./Utils.php");

    $post = getJsonParamter();

    $pet_id = $post['pet_id'];    

    $conn = getConnection();
    $sql = "SELECT username, avatar, date, content
            FROM board b LEFT JOIN user u
            ON b.user_id = u.username WHERE pet_id = ?";

    $data = query_list($conn, $sql, $pet_id);

    getJson(200, '获取成功', $data)
?>